package util;

public class LocalProxy {
	public static boolean USED = true;
	public static String HOST = "172.20.230.5";
	public static int PORT = 3128;
	
	public LocalProxy(String used, String host, String port) {
		USED = used != null && !"".equals(used) ? Boolean.parseBoolean(used) : false;
		HOST = host;
		PORT = port != null && !"".equals(port) ? Integer.parseInt(port) : -1;
	}

	public static void configSystemProxy() {
		if (LocalProxy.USED) {
			System.setProperty("http.proxyHost", LocalProxy.HOST);
			System.setProperty("http.proxyPort", String.valueOf(LocalProxy.PORT));
		}
	}
}
